
<div class="with-padding ">
<div class="row">
	<h2 class="step" style="margin-left:10px;">1 选择班级</h2>
	<div class="col-md-3">		
		<div class="input-group" style="">
			<span class="input-group-addon ">班级:</span>
			<select id="class" class="form-control" ng-model="class" ng-change="classChange()"  ng-options="class as class.name for class in classes"  ></select>
		</div>
	</div>
	<div class="col-md-3">
		<div class="input-group" style="">
			<span class="input-group-addon">考勤:</span>
			<select id="history" class="form-control" ng-model="history" ng-change="historyChange()"  ng-options="history as history.name for history in historys"  ></select>
		</div>
	</div>
</div>

<hr />

<div class="row">
	<form id="form" ng-submit="submit()">
		<div class="col-md-3" style="">
			<h2 class="step">2 <span ng-show="!isShow">填写</span>基础信息</h2>
			<label class="control-label">上课日期：</label>
			<div ng-show="isShow" class="control-content">{{record.date}}</div>
			<div ng-show="!isShow" class="input-group  date form-datetime" id="date">
	        	<input class="form-control" type="text" ng-model="record.date" required >
	        	<span class="input-group-addon"><span class="icon-calendar"></span></span>
	        </div>
	        
	        <div class="row" style="padding:10px 0;">
			    <div class="col-md-6">
			    	<label class="control-label">上课时间</label>
			    	<div ng-show="isShow" class="control-content">{{record.start_time}}</div>
			        <input ng-show="!isShow" class="form-control" id="start_time" ng-model="record.start_time" type="text" required oninvalid="this.setCustomValidity('请输入上课时间-_-!')" >
			     </div>
		        <div class="col-md-6">
		        	<label class="control-label">下课时间</label>
		        	<div ng-show="isShow" class="control-content">{{record.end_time}}</div>
			        <input ng-show="!isShow" class="form-control" id="end_time" ng-model="record.end_time" type="text" required >	
		        </div>
	        </div>

	        <label class="control-label">课时</label>  
	        <div ng-show="isShow" class="control-content">{{record.lesson_num}}</div>	
	        <input ng-show="!isShow" class="form-control" ng-change="lesson_numChange()" ng-model="record.lesson_num" type="number" min="0.5" max="4" step="0.5" required >
	 
	        
	        <label class="control-label">教学内容</label>  
	        <div ng-show="isShow" class="teach-plan-box" ng-repeat="teach_plan in record.teach_plan">	    		
				<div class="text-overflow teach-plan-content">{{teach_plan.plan_name}}</div>
			</div>	
	        <select ng-show="!isShow" id="teach_plan" class="form-control" multiple ng-change="teach_planChange()" ng-model="record.teach_plan"  ng-options="teach_plan as teach_plan.plan_name for teach_plan in teach_plans" required >
	        	
	        </select>
		      


	    </div>	
		<div class="col-md-9 ">
			<h2 class="step">3 <span ng-show="!isShow">进行</span>学生考勤</h2>
			<div class="panel">
				<table class="table datatable" style="margin-top:0;">
				    <thead>
					    <tr>
					    	<th></th>
					    	<th>姓名[学号]</th>
					    	<th>考勤</th>
					    	<th>课时</th>
					    	<th style="width:235px;">教学内容[掌握程度]</th>
					    	<th>备注</th>
					    </tr>
				  	</thead>
				  	<tbody>
					    <tr ng-repeat="(i,student) in students">
					    	<td >{{$index+1}}</td>
					    	<td >
					    		<p>{{student.name}} [{{student.stuid}}]</p>
					    		<p>
					    			<label class="label">剩余{{student.remain_lesson}}次课</label>
					    			<label class="label">剩余{{student.remain_day}}天</label>
					    		</p>
					    	</td>
					    	<td>

					    		<div ng-click="record.student[i].is_attend = !record.student[i].is_attend" class="switch-box">
					    			<div ng-class="{true: 'switch-on', false: 'switch-off'}[record.student[i].is_attend]">
					    				<span class="switch-left">出勤</span>
					    				<label>&nbsp;</label>
					    				<span class="switch-right">缺勤</span>
					    			</div>
					    		</div>
					    	</td>
					    	<td>
					    		<div ng-show="isShow">{{record.student[i].lesson_num}}</div>
					    		<input ng-show="!isShow" class="form-control form-lesson-num" ng-model="record.student[i].lesson_num"  type='number' min="1" max="4" step="0.5" />

					    	</td>
					    	<td style="width:235px;">
					    		<div class="teach-plan-box" ng-repeat="student_teach_plan in record.student[i].teach_plan">
					    		
					    			<div class="text-overflow teach-plan-content">{{student_teach_plan.plan_name}}</div>
					    			<div class="form-master-level-box">
					    				<div ng-show="isShow">{{student_teach_plan.master_level}}</div>
					    				<input ng-show="!isShow" type="number" min="1" max="5" class="form-control form-master-level input-sm" ng-model="student_teach_plan.master_level" />
					    			</div>
					    		</div>
					    		
					    		<a ng-show="!isShow" class="btn btn-sm btn-primary" ng-click="teach_plansShow = !teach_plansShow"><span class="icon-edit"></span></a>
					    		<select ng-show="teach_plansShow" class="teach_plan form-control" multiple ng-model="record.student[i].teach_plan" ng-options="teach_plan as teach_plan.plan_name for teach_plan in teach_plans" >
					    			
					    		</select>
					    		
					    	</td>	    	
					    	
					    	<td>
					    		<div ng-show="isShow">{{record.student[i].remark}}</div>
					    		<textarea ng-show="!isShow" class="form-control" ng-model="record.student[i].remark" rows="2"></textarea>
					    	</td>
					    </tr>
				  	</tbody>
				</table>
			</div>	

			<div>
				<label class="control-label">课堂总结</label> 
				<div ng-show="isShow">{{record.remark}}</div> 	
	        	<textarea ng-show="!isShow" class="form-control" ng-model="record.remark" rows="3" required ></textarea>
			</div>	

			<div class="pull-right" style="margin-top:15px;">
				<button ng-show="!isShow && !couldEdit" class="btn btn-primary" type="submit" >提交</button>
				<a ng-show="isShow && couldEdit" ng-click="isShow = !isShow" class="btn btn-primary" type="submit" >编辑</a>
				<a ng-show="isShow && couldEdit" ng-click="delete()" class="btn" type="submit" >删除</a>
				<button ng-show="!isShow && couldEdit" class="btn btn-primary" type="submit" >更新</button>
				<a ng-show="!isShow && couldEdit" ng-click="isShow = !isShow" class="btn" type="submit" >取消</a>
			</div>
		</div>
	</form>
	
</div>
	
</div>